package com.hyz.controller;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.hyz.pojo.RepositoryCharge;
import com.hyz.service.RepositoryChargeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;


/**
 * @author HGD
 * @date 2022/10/4 0:34
 */
@RestController
@RequestMapping("/RepositoryRepoManager")
public class RepositoryChargeController {
    @Autowired
    private RepositoryChargeService service;

    @PostMapping("/getRepositoryChargeByRepositoryManagerId")
    public List<RepositoryCharge> getRepositoryChargeByRepositoryManagerId(@RequestBody Long repositoryManagerId) {
        LambdaQueryWrapper<RepositoryCharge> wrapper = new LambdaQueryWrapper<>();
        wrapper.eq(RepositoryCharge::getRepoManagerId, repositoryManagerId);
        return service.list(wrapper);
    }
}
